#!/bin/bash
dbname_file=$(cat /data/shell/dbname.txt)
mysql_addr='10.200.1.141'
dbuser='root'
dbpassword='devops@mariadb'
dbport='3306'
backup_dir='/data.mysql/2023-03'

for dbname in $dbname_file; do
    /usr/bin/mysql --host=$mysql_addr --user=$dbuser --password=$dbpassword --port=$dbport --database=$dbname <$backup_dir/$dbname.sql
    echo "正在导入 "$dbname
done
